import api from '../../api';
import { message } from 'antd';

export default {
  namespace: 'seriesProductManageM',

  state: {},

  effects: {
    //查询系列产品列表
    *queryTableList({ payload, callback }, { call, put }) {
      const response = yield call(api.seriesProductManage.queryTableList, payload);
      if (response && response.code == 0) {
        callback('success', response.data);
      } else {
        callback('fail');
        message.error(response?.msg || '查询系列产品列表失败!');
      }
    },
  },

  reducers: {
    save(state, { payload }) {
      return {
        ...state,
        ...payload,
      };
    },
  },
};
